A mobile device such as a cellular phone or a smart phone can be equipped with a magnetometer, a sensor that detects the strength and/or direction of a magnetic field. The magnetometer can be used along with other sensors, such as an accelerometer that senses orientation and velocity. Sensor readings from the magnetometer and accelerometer can be combined to provide a “heading” or “direction” much like a compass. The heading is typically given relative to a direction towards magnetic north, which can be different from the direction towards the Earth's geographic North pole, i.e., true north. The direction information may be provided for the user's own navigation knowledge, for example, to tell the user a heading relative to the direction of magnetic north while the user is walking or driving in unfamiliar surroundings. The direction information can also be used by a navigation or map application that may be running on the device.
A magnetometer can provide a measure of the magnetic field that is present in the immediate surroundings of the device as a two or three-component vector in a Cartesian coordinate system using a two or three-axis magnetic sensor. The sensed magnetic field can include a contribution from the Earth's geomagnetic field. The contribution from the Earth's geomagnetic field can vary based on space, e.g., geographic location, and time mainly due to complex interactions of an electromagnetic dynamo in the Earth's core.
The direction of magnetic north derived from the sensor readings can be corrected to identify a true north (geographic north) direction. Typically, a user consults a geomagnetic map (e.g., a geomagnetic map provided by the U.S. Geological Survey (USGS)) that shows the relationships between magnetic north and true north for a particular geographic area, where other characteristics of the environment, e.g., temperature can be considered substantially constant. In particular, the geomagnetic map can identify the magnitudes of declination at different locations in the geographic area. After identifying the magnitude of declination at a geographic location, a user can correct the magnetic heading using the magnetic variation (declination).
The correction technique described above is effective but can be time consuming. As the user travels with a mobile device, for example, the magnetic variation can change.